package com.example.sls.controller.social;

import com.example.sls.pojo.social.PrivateMessages;
import com.example.sls.service.intserfaces.social.PrivateMessagesService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 私信聊天表(PrivateMessages)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:44
 */
@RestController
@RequestMapping("social/privateMessages")
public class PrivateMessagesController {
  @Autowired
  PrivateMessagesService privateMessagesService;

  @GetMapping("queryById")
  PrivateMessages queryById(Integer id) {
    return privateMessagesService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<PrivateMessages> queryAllByLimit(PrivateMessages privateMessages, Integer pageSize, Integer offset) {
    return privateMessagesService.queryAllByLimit(privateMessages, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return privateMessagesService.count();
  }

  @GetMapping("insert")
  int insert(PrivateMessages privateMessages) {
    return privateMessagesService.insert(privateMessages);
  }

  @GetMapping("update")
  int update(PrivateMessages privateMessages) {
    return privateMessagesService.update(privateMessages);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return privateMessagesService.deleteById(id);
  }
}

